package com.org.javabody.iterator;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

/**
 * Created by admin on 2017/2/7.
 */
public class IteratorDemo {
    public List<HashMap<String,String>>  showList() {
         List<HashMap<String,String>> list = new ArrayList<HashMap<String,String>>();
        for(int i=0;i<3;i++){
            HashMap<String,String> hashMap =new HashMap<String,String>();
            hashMap.put(i+"",i+"A");
            list.add(hashMap);
        }
        return  list;
    }
        public static void main (String[]args){
            List<HashMap<String,String>> list = new IteratorDemo().showList();
            Iterator it = list.iterator();
            while (it.hasNext()) {
                    System.out.println(it.next());
            }
        }
}
